/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package model.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dingnangen
 */
@Entity
@Table(name = "tracehistory")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tracehistory.findAll", query = "SELECT t FROM Tracehistory t"),
    @NamedQuery(name = "Tracehistory.findByIdtracehistory", query = "SELECT t FROM Tracehistory t WHERE t.idtracehistory = :idtracehistory")})
public class Tracehistory implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idtracehistory")
    private Integer idtracehistory;
    @Lob
    @Size(max = 2147483647)
    @Column(name = "tracehistory")
    private String tracehistory;
    @JoinColumn(name = "idoperationrecord", referencedColumnName = "idoperationrecord")
    @ManyToOne(optional = false)
    private Operationrecord idoperationrecord;
    @JoinColumn(name = "idtask", referencedColumnName = "idtask")
    @ManyToOne(optional = false)
    private Task idtask;

    public Tracehistory() {
    }

    public Tracehistory(Integer idtracehistory) {
        this.idtracehistory = idtracehistory;
    }

    public Integer getIdtracehistory() {
        return idtracehistory;
    }

    public void setIdtracehistory(Integer idtracehistory) {
        this.idtracehistory = idtracehistory;
    }

    public String getTracehistory() {
        return tracehistory;
    }

    public void setTracehistory(String tracehistory) {
        this.tracehistory = tracehistory;
    }

    public Operationrecord getIdoperationrecord() {
        return idoperationrecord;
    }

    public void setIdoperationrecord(Operationrecord idoperationrecord) {
        this.idoperationrecord = idoperationrecord;
    }

    public Task getIdtask() {
        return idtask;
    }

    public void setIdtask(Task idtask) {
        this.idtask = idtask;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtracehistory != null ? idtracehistory.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tracehistory)) {
            return false;
        }
        Tracehistory other = (Tracehistory) object;
        if ((this.idtracehistory == null && other.idtracehistory != null) || (this.idtracehistory != null && !this.idtracehistory.equals(other.idtracehistory))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.entity.Tracehistory[ idtracehistory=" + idtracehistory + " ]";
    }
    
}
